<style xmlns:th="http://www.w3.org/1999/xhtml" >
.pdding7{padding-top: 7px;margin-top: 7px;}
</style>
					<form xmlns:th="http://www.w3.org/1999/xhtml" id="form_merchant_add_1" method="post" action="merchant/add" class="form-horizontal bv-form" >
							<div class="form-body">
								<input  type="hidden" name="uid" th:value="${uid}"/>
								<div class="form-group" >
									<label  class="col-md-3 control-label">商户名称:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text" placeholder="商户(公司)名称，与营业执照一致" name='merchantName'  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">商户简称:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='merchantSimpleName' placeholder="商户(公司)简称，支付时显示的名称"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">联系人姓名:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='linkmanName' placeholder="联系人(负责人)真实姓名"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">联系人电话:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='linkmanMobile' placeholder="联系人手机号(商户号使用该手机号注册)"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">客服电话:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='servicePhone' placeholder="客服手机号码或固定电话号码（固定号码格式为xxx-xxxxxxxx）"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">电子邮箱:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='email' placeholder="商户电子邮箱"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">商户类别及行业:
									</label>
									<div class="col-md-9 left ">
										<select name="merchantTypeId" id="merchantType">
											<option value="0">--商户类别--</option>
											<option th:each="mt:${merchantTypes}"  th:value="${mt.vocationId}" th:text="'--'+${mt.vocationName}+'--'"></option>
										</select>
										<select name="firstVocationId" id="firstVocation">
											<option value="0">--一级行业--</option>
										</select>
										<select name="secondVocationId" id="secondVocation">
											<option value="0">--二级行业--</option>
										</select>
									</div>
								</div>

								<div class="form-group" id="">
									<label  class="col-md-3 control-label">详细地址:
									</label>
									<div class="col-md-9 left ">
										<select name="provinceRegionId" id="regionProvince1">
											<option value="0">--省份--</option>
											<option th:each="pro:${provinces}"  th:value="${pro.regionId}" th:text="'--'+${pro.regionName}+'--'"></option>
										</select>
										<select name="cityRegionId" id="regionCity1">
											<option value="0">--市--</option>
										</select>
										<select name="countyRegionId" id="regionCounty1">
											<option value="0">--区县--</option>
										</select>
									</div>
								</div>
								<div class="form-group" >
									<label  class="col-md-3 control-label">
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='detailAddress' placeholder="详细地址(精确到门牌号)"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">法人姓名:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='legalPersonName' placeholder="法人真实姓名"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">法人电话:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='legalPersonMobile' placeholder="法人手机号"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">法人身份证号:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='legalPersonIdNumber' placeholder="法人身份证号"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">身份证有效期:
									</label>
									<div class="widget-buttons">
										<div id="reservation"  style="background: #fff; cursor: pointer; border: 1px solid #ccc;padding: 5px 10px;line-height:16px;">
											<i class="glyphicon glyphicon-calendar fa fa-calendar blue"></i>
											<span th:text="${timeFrame}"></span> <b class="caret"></b>
										</div>
									</div>
									<input id="-id-datetime_time" type="hidden" name="idnumberTime" th:value="${timeFrame}" value="" />
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">营业执照号:
									</label>
									<div class="col-md-9">
										<input class='form-control ' type="text"  name='businessLicenseNumber' placeholder="营业执照号，如实填写"  data-bv-notempty='true' data-bv-notempty-message='此处不能为空！' value=""  />
									</div>
								</div>

								<div class="form-group" >
									<label  class="col-md-3 control-label">营业执照有效期:
									</label>
									<div class="widget-buttons">
										<div id="reservation2"  style="background: #fff; cursor: pointer; border: 1px solid #ccc;padding: 5px 10px;line-height:16px;">
											<i class="glyphicon glyphicon-calendar fa fa-calendar blue"></i>
											<span th:text="${timeFrame}"></span> <b class="caret"></b>
										</div>
									</div>
									<input id="-id-datetime_time2" type="hidden" name="licencenumberTime" th:value="${timeFrame}" value="" />
								</div>

						</div>
							<div class="  form-group ">
								<div class="pull-right form-btn">
									<button class="btn btn-warning" type="reset"><i class="ace-icon fa fa-undo bigger-110"></i> 重置	</button>
									<button type="submit" class="btn btn-info"><i class="ace-icon fa fa-check bigger-110"></i>确认</button>
								</div>
							</div>
							</form>
<script type="text/javascript">

//^[0-9a-zA-Z]+[0-9a-zA-Z\.-]*\.[a-zA-Z]{2,4}$

jQuery(document).ready(function() {

	//身份证时间
	var cb = function(start, end, label) {
		$('#reservation span').html(start.format('YYYY-MM-DD') + '至' + end.format('YYYY-MM-DD'));
		$('#-id-datetime_time').val(start.format('YYYY-MM-DD') + '至' + end.format('YYYY-MM-DD'));
		// loadChartData();
	};

	var optionSet1 = {
//	         startDate: moment().subtract(29, 'days'),
		startDate: moment(),
		endDate: moment(),
//	         minDate: '',
		maxDate: moment().subtract(0, 'days'),
		dateLimit: { days: 1e5 },
		showDropdowns: true,
		showWeekNumbers: true,
		timePicker: false,
		ranges: {
			'今天': [moment(), moment()],
			'昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
			'最近 7 天': [moment().subtract(6, 'days'), moment()],
			'最近 30 天': [moment().subtract(29, 'days'), moment()],
			'本月 ': [moment().startOf('month'), moment().endOf('month')],
			'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
		},
		opens: 'left',
		buttonClasses: ['btn btn-green'],
		applyClass: 'btn-sm btn-primary',
		cancelClass: 'btn-sm',
		format: 'YY/MM/DD',
		separator: '至',
		locale: {
			applyLabel: '确定',
			cancelLabel: '取消',
			fromLabel: '开始',
			toLabel: '结束',
			customRangeLabel: '自定义',
			daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
			monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
			firstDay: 1
		}
	};
	$('#reservation').daterangepicker(optionSet1,cb);

	//营业执照时间
	var cb = function(start, end, label) {
		$('#reservation2 span').html(start.format('YYYY-MM-DD') + '至' + end.format('YYYY-MM-DD'));
		$('#-id-datetime_time2').val(start.format('YYYY-MM-DD') + '至' + end.format('YYYY-MM-DD'));
		// loadChartData();
	};

	var optionSet1 = {
//	         startDate: moment().subtract(29, 'days'),
		startDate: moment(),
		endDate: moment(),
//	         minDate: '',
		maxDate: moment().subtract(0, 'days'),
		dateLimit: { days: 1e5 },
		showDropdowns: true,
		showWeekNumbers: true,
		timePicker: false,
		ranges: {
			'今天': [moment(), moment()],
			'昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
			'最近 7 天': [moment().subtract(6, 'days'), moment()],
			'最近 30 天': [moment().subtract(29, 'days'), moment()],
			'本月 ': [moment().startOf('month'), moment().endOf('month')],
			'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
		},
		opens: 'left',
		buttonClasses: ['btn btn-green'],
		applyClass: 'btn-sm btn-primary',
		cancelClass: 'btn-sm',
		format: 'YY/MM/DD',
		separator: '至',
		locale: {
			applyLabel: '确定',
			cancelLabel: '取消',
			fromLabel: '开始',
			toLabel: '结束',
			customRangeLabel: '自定义',
			daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
			monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
			firstDay: 1
		}
	};
	$('#reservation2').daterangepicker(optionSet1,cb);
	
	FormSamples.init({
		formId:'form_merchant_add_1'
	});

	$("#merchantType").change(function(){
		var pid = $(this).val();
		$.post("vocation/type",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("firstVocation");
			obj.innerHTML="";
			// if(len>1){
			// 	var nullOp = document.createElement("option");
			// 	nullOp.setAttribute("value","");
			// 	nullOp.appendChild(document.createTextNode("--一级行业类别--"));
			// 	obj.appendChild(nullOp);
			// }
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.vocationId);
				nullOp.appendChild(document.createTextNode(json.vocationName));
				obj.appendChild(nullOp);
			});
		});
	});

	$("#firstVocation").change(function(){
		var pid = $(this).val();
		$.post("vocation/type",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("secondVocation");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--二级行业类别--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.vocationId);
				nullOp.appendChild(document.createTextNode(json.vocationName));
				obj.appendChild(nullOp);
			});
		});
	});

	$("#regionProvince1").change(function(){
		var pid = $(this).val();
		$.post("region/cities",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCity1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--市--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});

	$("#regionCity1").change(function(){
		var pid = $(this).val();
		$.post("region/counties",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCounty1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--地区--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});

});
</script>